package com.common.rabbitmq.producer.core;

import com.common.handler.ExchangeServiceHandler;
import com.common.rabbitmq.producer.AbstractProducer;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MediaProducer extends AbstractProducer {
    private static final String defaultExchange = ExchangeServiceHandler.MEDIA_EXCHANGE;
    private static final String deadLetterExchange = "";


    @Override
    public String getExchange() {
        return defaultExchange;
    }

    @Override
    public String getDeadLetterExchange() {
        return deadLetterExchange;
    }

    /**
     * 根据id移除媒资文件
     * @param mediaId
     */
    public void mediaRemoveById(Long mediaId) {
        send("media.remove.id", mediaId);
    }

    /**
     * 根据id集合批量移除媒资文件
     * @param ids
     */
    public void mediaRemoveByIds(List<Long> ids) {
        send("media.remove.ids", ids);
    }
}
